package T5_Why_un_synchronized_1;
public class Why_un_synchronized_1 {
	public static void main(String[] args) { 
		Runnable r1 = new MyThread();    // 为什么锁不住了
		Runnable r2 = new MyThread(); 
		Thread t1 = new Thread(r1); 
		Thread t2 = new Thread(r2); 
		t1.start(); 
		t2.start(); 
	} 
}  
class MyThread implements Runnable{
	public synchronized void run(){ 
		for(int i=0;i<10;i++) { 
			System.out.print(" " + i); 
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		} 
		System.out.println("end"); 
	} 
}
